package br.com.cfccultura.admin.view.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class BancoIconeTag extends TagSupport {
	
	private static final long serialVersionUID = 3320495987900767060L;
	
	private String src;
	
	@Override
	public int doStartTag() throws JspException {
		
		if(getSrc() == null || getSrc().equals(""))
			setSrc("banco.png");
		
		String urlImg = "<img src='_images/icones/" + getSrc() + "' border='0'/>";
		JspWriter out = pageContext.getOut();
		try {
			out.print(urlImg);
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return super.doStartTag();
	}
	
	public String getSrc() {
		return src;
	}
	public void setSrc(String src) {
		this.src = src;
	}
}
